﻿using Azylee.WinformSkin.StyleUtils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

namespace JustMetClient.Forms
{
    public partial class NoTitleFormBase : Form
    {
        Label BorderTop = new Label();
        Label BorderBottom = new Label();
        Label BorderLeft = new Label();
        Label BorderRight = new Label();

        public NoTitleFormBase()
        {
            InitializeComponent();
            this.DoubleBuffered = true;
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.  
            SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲  
        }
       
         #region 界面优化
        /// <summary>
        /// 避免拖动窗口闪烁，使用会导致Windows自带动画失效
        /// </summary>
        protected override CreateParams CreateParams
        {
            get
            {
                const int WS_MINIMIZEBOX = 0x00020000;  // Winuser.h中定义  
                CreateParams cp = base.CreateParams;
                cp.Style = cp.Style | WS_MINIMIZEBOX;   // 允许最小化操作
                cp.ExStyle |= 0x02000000;  // Turn on WS_EX_COMPOSITED（任务栏点击最大化最小化）
                return cp;
            }
        }
        #endregion


    }
}
